package com.design.mediator;

/**
 * @author cxx
 * @create 2020-04-20 17:40
 **/
public class ConcreteColleagueB implements Colleague {

    private Mediator mediator;

    @Override
    public void receiveMsg(String name,String fromUid) {
        System.out.println ("B接受到数据来自："+fromUid+" msg="+name);
    }

    @Override
    public void sendMsg(String msg, String fromUid,String toUid) {
        System.out.println ("B发送数据到"+toUid+",msg="+msg);
        mediator.operation (fromUid,toUid,msg);
    }


    @Override
    public void setMediator(Mediator mediator) {
        this.mediator = mediator;
    }
}
